import { useAxios } from '@/hooks/web/useAxios'
const request = useAxios()
import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 药品出入库列表
export const spDrugInOutOrderListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spDrugInOutOrderList',
      data: data
    }
  })
}

// 药品出入查看
export const spDrugInOutOrderSeeApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spDrugInOutOrderSee',
      data: data
    }
  })
}

// 主表修改
export const spDrugInOutOrderEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spDrugInOutOrderEdit',
      data: data
    }
  })
}
// 药品档案列表
export const spDrugListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spDrugList',
      data: data
    }
  })
}

// 药品档案列表
export const faMedicalOrderListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'faMedicalOrderList',
      data: data
    }
  })
}

// 药品批次列表
export const spDrugBatchListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spDrugBatchList',
      data: data
    }
  })
}
// 药品添加
export const spDrugInOutOrderAddAdminApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spDrugInOutOrderAddAdmin',
      data: data
    }
  })
}

// 药品明细出入修改
export const spDrugInOutOrderSetApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spDrugInOutOrderSet',
      data: data
    }
  })
}

// 归档
export const spDrugInOutOrderEndApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spDrugInOutOrderEnd',
      data: data
    }
  })
}

// 删除
export const spDrugInOutOrderDelApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spDrugInOutOrderDel',
      data: data
    }
  })
}

// 饲料规格查看
export const spForageSpecsSeeApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageSpecsSee',
      data: data
    }
  })
}
